#ifndef __RTSP_H264LIVESOURCE_H_
#define __RTSP_H264LIVESOURCE_H_


#include "liveMedia.hh"
#include "BasicUsageEnvironment.hh"
#include "GroupsockHelper.hh"
#include "FramedSource.hh"
#include "rtsp_ringBuffer.h"
#include "rtsp.h"


#define FRAME_PER_SEC 30

#define TRUNCATEDBUFFSIZE 60*1024



class rtsp_h264liveSrouce : public FramedSource
{
public:
	rtsp_h264liveSrouce(UsageEnvironment &env, CRingBuffer<vidPacket> *ring_buf);
	~rtsp_h264liveSrouce(void);

public:
	virtual void doGetNextFrame();
	virtual unsigned int maxFrameSize() const;

	static void getNextFrame(void * ptr);
	void GetFrameData();
	int32_t get_fps();

private:
	void *m_pToken;
	char *m_pFrameBuffer;
	int  m_hFifo;

	pthread_mutex_t _mutex;
	int32_t _fTruncatedBytesNum; //单次没有传输完成，剩余的字节数量
	char *_fTruncatedBytes; //单次没有传输完成，剩余的字节
	CRingBuffer<vidPacket> *_h264_ringBuf;
};



#endif

